    <?php
		$base = mysql_connect ('localhost', 'root', 'master'); 
		mysql_select_db ('easyimmo', $base); 
		
		if (isset($_GET['item'])) {
			$sql = "DELETE FROM type_piece WHERE id_type_piece = '".mysql_real_escape_string($_GET['item'])."';";
			$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); 
			$data = mysql_fetch_array($req); 
			mysql_free_result($req); 
			mysql_close(); 

			session_start(); 
			header('Location: pieces.php'); 
			exit(); 	
		}
		/*
		if (isset($_GET['selection'])) {
			
			for ($i=0;$i<count($_POST['selection']);$i++)
			{
				echo "".$choix = $_POST['selection'][$i];								
			}										
			
			//======= SEPARATE
			$sql = "DELETE FROM type_piece WHERE id_type_piece = IN('.implode(',',$_POST['msg']).')';";
			$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); 
			$data = mysql_fetch_array($req); 
			mysql_free_result($req); 
			mysql_close(); 

			session_start(); 
			header('Location: pieces.php'); 
			exit(); 
						
		}	
		*/
    ?> 			